home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / MAGS.ZIP / 40HEX-14.ZIP / 40hex-14.002 < prev    next >
Encoding:
Text File  |  1995-04-13  |  27.2 KB  |  907 lines

  1. 40Hex Number 14 Volume 5 Issue 1                                      File 002
  2.  
  3.            KILLSMEG (c) 1994 by Stormbringer of Phalcon/Skism
  4.  
  5. Note: This is an update to an earlier program, KILLQUEEG, which misfired
  6.       badly when it encountered SMEG.Pathogen, as Pathogen is functionally
  7.       almost IDENTICAL to Queeg and would scan the same in the old program,
  8.       but become a disaster on disinfection.  KILLSMEG will scan and 
  9.       disinfect both correctly, as well as most new variants.  Variants
  10.       that it is not likely to be able to disinfect it will report as
  11.       a new variant of SMEG.
  12.  
  13.  
  14. DISCLAIMER:  Author assumes NO liabilities for any damage this software
  15.              might cause.  It is not guaraunteed in any way.  I have done
  16.              my best to make it secure and bug free, but it comes as is.
  17.              Use it at your own risk.
  18.  
  19.    This program will find and disinfect the two SMEG viruses from specified 
  20. files in current directory.  Before using, boot from a CLEAN-WRITE PROTECTED
  21. disk, and make sure you get this program from a reliable source (source
  22. code should be included).
  23.  
  24.    I wrote this as there is currently no shareware/freeware program available 
  25. capable of disinfecting this polymorphic virus, or even reliably detecting
  26. it.  It also gives insight into one technique that can be used to detect and/
  27. or disinfect polymorphic viruses.
  28.  
  29.    I can be reached via IRC or anywhere else if ya look hard enough ;)
  30.  
  31. Greets go to: Phalcon/Skism, Trident, Trinity, Hermanni, Frisk, Frans, Jenky,
  32.               and all the rest of the virus/anti-virus community.
  33.  
  34. ---------------------------
  35. ;KillSMEG (c) 1994 Stormbriner, Phalcon/Skism
  36. ;Finds and disinfects the original SMEG viruses (Pathogen and Queeg)
  37.  
  38. ;Author assumes NO responsibility for any damages caused by this program
  39. ;or by the SMEG viruses themselves.  This utility is simply made to find it,
  40. ;and may or may not work as it is supposed to.  No garuantees.
  41.  
  42. ;First phase is to look for time signatures.  The seconds in any Queeg
  43. ;infected file (unless something else has changed timestamp after infection)
  44. ;is 56 seconds (1c in bits 0-4 of the time sig).  All following Checks are
  45. ;done regardless of the time sig check.  Pathogen marks infections by making
  46. ;the high byte in the date > 0c8h
  47.  
  48. ;Second Phase on each file is to Check if it's an .EXE or a .COM.
  49.  
  50. ;Third phase is to trace the program until an invalid condition is found or
  51. ;the virus is detected.
  52.  
  53. ;Finally, the user is asked if s/he wishes to disinfect the virus, and
  54. ;the file is cleaned.
  55.  
  56. Strengths:
  57. ;       VERY reliable detection rate from my testing.
  58. ;
  59. ;       Currently only free program capable of disinfecting SMEG viruses, 
  60. ;       especially from .EXE files.
  61. ;
  62. ;       Comes with full source code.
  63.  
  64. ;Weaknesses:
  65. ;       Third phase is slow(!!!), and actually executes part of program, 
  66. ;       although it is careful not to allow detrimental actions to be taken 
  67. ;       (i.e. viruses cannot go memres, etc.)
  68. ;
  69. ;       Only scans current directory using user filemask.
  70. ;
  71. ;       Disinfection will leave some garbage at the end of files,
  72. ;       as the virus pads its hosts to the paragraph boundaries.
  73. ;       This will cause self-checking programs to choke.
  74.  
  75. .model tiny
  76. .radix 16
  77. .code
  78.         org 100
  79. start:
  80. ReduceMem:
  81.         mov     ah,4a
  82.         mov     bx,(endfinder-start+10f)/10     ;Reduce Memory to that needed
  83.         int     21
  84.  
  85.         mov     sp,offset TopStack              ;Set STack within memory
  86.  
  87.         mov     ah,09
  88.         mov     dx,offset IntroMSG
  89.         int     21
  90.  
  91.         cmp     byte ptr ds:[80],1
  92.         ja      CopyFilename
  93.         mov     ah,09
  94.         mov     dx,offset Instructions
  95.         int     21
  96.         mov     ax,4c00
  97.         int     21
  98. CopyFilename:
  99.         mov     si,82
  100.         mov     di,offset Filenamebuf
  101.     CopyFN:
  102.         lodsb
  103.         cmp     al,0dh
  104.         je      doneCFN
  105.         stosb
  106.         jmp     CopyFN
  107. doneCFN:
  108.         xor     al,al
  109.         stosb
  110.  
  111. ComSearch:
  112.         mov     ah,4e
  113.         mov     dx,offset FilenameBuf
  114.         mov     cx,07
  115.   FindFirstNext:        
  116.         int     21
  117.         jnc     SearchGood
  118.         jmp     NoMoreCOMS
  119.   SearchGood:
  120.         call    notifycheck
  121.  
  122.         mov     cx,ds:[96]
  123.         and     cl,1f
  124.         cmp     cl,1c                   ;Check time stamp (56 seconds)
  125.         jne     AfterTimeCheck1
  126.         call    SuspiciousTime
  127.   AfterTimeCheck1:
  128.         mov     cx,ds:[98]
  129.         cmp     ch,0c8
  130.         jb      AfterTimeCheck
  131.         call    PathTime
  132.  
  133.   AfterTimeCheck:
  134.         mov     ax,3d00
  135.         mov     dx,9e
  136.         int     21
  137.         jnc     ATCGood
  138.         jmp     ErrorOpen
  139.   ATCGood:
  140.         xchg    bx,ax
  141.         mov     dx,offset EXECCheck
  142.         mov     cx,4
  143.         mov     ah,3f
  144.         int     21
  145.         mov     ah,3e
  146.         int     21                              ;Close File
  147.         mov     ax,word ptr ds:[ExecCheck]
  148.         xor     ah,al
  149.         cmp     ah,('M' xor 'Z')                ;Check if it's a com or exec
  150.         je      ISEXE
  151.         push    cs
  152.         pop     es
  153.         mov     di,offset JmpByte
  154.         mov     si,offset ExecCheck             ;Save Jump
  155.         movsb
  156.         movsw
  157.         mov     byte ptr ds:[COMEXE],0
  158.         jmp     short OtherChecks
  159.     ISEXE:        
  160.         mov     byte ptr ds:[COMEXE],1        
  161.   OtherChecks:        
  162.         mov     Infected,0                      ;Initialize to not infected
  163.         mov     TraceDone,0
  164.         call    LoadAndCheckFile                ;Trace file
  165.         cmp     Infected,1
  166.         jne     FindAnotherFile
  167.                
  168.         call    PrintFilename
  169.         cmp     Knownvir,1
  170.         je      DisinfectProg
  171.         mov     ah,09
  172.         mov     dx,offset NewVar
  173.         int     21
  174.         jmp     FindAnotherFile
  175.  
  176. DisinfectProg:
  177.         mov     ah,09
  178.         mov     dx,offset InfectedMSG
  179.         int     21
  180.  
  181.         xor     ax,ax
  182.         int     16
  183.         push    ax
  184.         mov     dx,offset DoneChecking
  185.         mov     ah,09
  186.         int     21
  187.         pop     ax
  188.         or      al,20
  189.         cmp     al,'y'
  190.         jne     FindAnotherFile
  191.    Disinfect:
  192.         cmp     comexe,1
  193.         je      DisEXE
  194.         call    DisinfCom
  195.         jmp     short FindAnotherFile
  196.    DisEXE:
  197.         call    DisinfExe
  198.   FindAnotherFile:
  199.         mov     ah,4f
  200.         jmp     FindFirstNext
  201.  
  202. ErrorOpen:
  203.         call    PRintFilename
  204.         mov     ah,09
  205.         mov     dx,offset OpenError
  206.         int     21
  207.         jmp     FindAnotherFile
  208.  
  209. NoMoreCOMS:
  210.         mov     ax,4c00
  211.         int     21
  212.  
  213. SuspiciousTime:        
  214.         call    PrintFilename
  215.         mov     ah,09
  216.         mov     dx,offset TIMEMSG
  217.         int     21
  218.         ret
  219. PathTime:
  220.         call    printfilename
  221.         mov     ah,09
  222.         mov     dx,offset pathtimemsg
  223.         int     21
  224.         ret
  225.  
  226.  
  227. NotifyCheck:
  228.         
  229.         mov     dx,offset Checking
  230.         mov     ah,09
  231.         int     21
  232.         call    PrintFileName
  233.         mov     dx,offset DoneChecking
  234.         mov     ah,09
  235.         int     21
  236.         ret
  237.  
  238.  
  239. PrintFilename:        
  240.         mov     si,9e
  241.   PrintFN:        
  242.         lodsb
  243.         or      al,al
  244.         jz      doneprintfn
  245.         mov     ah,02
  246.         mov     dl,al
  247.         int     21
  248.         jmp     Printfn
  249.     DonePrintFN:
  250.         ret
  251.  
  252. LoadAndCheckFile:
  253.         push    cs
  254.         pop     ds
  255.         mov     ax,ds:[2c]
  256.         mov     EnvSeg,ax
  257.         mov     ax,ds
  258.         mov     word ptr [CommandTail+2],ax
  259.         mov     word ptr [FCB1+2],ax
  260.         mov     word ptr [FCB2+2],ax
  261.         mov     ax,offset ParmData
  262.         mov     word ptr [CommandTail],ax
  263.         mov     word ptr [FCB1],ax
  264.         mov     word ptr [FCB2],ax
  265.  
  266.         mov     ax,3501
  267.         int     21
  268.         mov     IP01,bx
  269.         mov     CS01,es         ;Get int 1 vector
  270.  
  271.         mov     ax,2501
  272.         mov     dx,offset Int01  ;And set it
  273.         int     21
  274.         mov     ax,ss
  275.         mov     Oldss,ax
  276.         mov     oldsp,sp
  277.         push    cs
  278.         pop     es
  279.  
  280.      LoadFile:
  281.         mov     ax,4b01
  282.         mov     bx,offset ParmBlock
  283.         mov     dx,9e
  284.         int     21
  285.         jc      ErrorExecute
  286.     SetupExec:        
  287.         push    cs
  288.         pop     ds
  289.         mov     ax,2522
  290.         mov     dx,offset ExecuteTerminated
  291.         int     21                              ;Set Termination address
  292.  
  293.         mov     ah,62
  294.         int     21
  295.         push    bx bx
  296.         pop     es ds
  297.         
  298.         mov     word ptr cs:[StartDS],bx
  299.  
  300.         mov     ax,cs
  301.         mov     word ptr ds:[0a],offset ExecuteTerminated
  302.         mov     word ptr ds:[0c],ax                      ;Set Termination Address
  303.         
  304.         cli
  305.         mov     ax,word ptr cs:[NewStack+2]
  306.         mov     ss,ax
  307.         mov     sp,word ptr cs:[NewStack]
  308.         sti
  309.  
  310.         pushf
  311.         pop     ax
  312.         or      ax,0100
  313.         xor     bx,bx
  314.         xor     cx,cx
  315.         xor     dx,dx
  316.         mov     si,100
  317.         xor     di,di
  318.         xor     bp,bp
  319.         push    word ptr cs:[NewCS]
  320.         push    word ptr cs:[NewIP]
  321.         push    ax
  322.         popf
  323.         retf
  324.  
  325. ExecuteTerminated:
  326.         cld
  327.         pushf
  328.         pop     ax
  329.         and     ax,not 100      ;ditch trapflag
  330.         push    ax
  331.         popf
  332.         cli
  333.         mov     ax,cs:[OldSS]
  334.         mov     ss,ax
  335.         mov     sp,cs:[OldSP]
  336.         sti
  337.         lds     dx,dword ptr cs:[IP01]
  338.         mov     ax,2501
  339.         int     21
  340.         push    cs cs
  341.         pop     es ds
  342.  
  343.         mov     ah,1a
  344.         mov     dx,80                   ;Reset DTA
  345.         int     21
  346.    ErrorExecute:
  347.         ret
  348.  
  349. OldSS   dw      0
  350. OldSP   dw      0
  351.  
  352.  
  353. Int01:
  354.         cld
  355.         push    bp
  356.         mov     bp,sp
  357.         add     bp,2
  358.         push    ax bx cx dx es ds si di
  359.         cmp     cs:TraceDone,1
  360.         je      DOneInt01
  361.         call    CheckESDS   
  362.         call    CheckOPCode
  363.         jne     DoneInt01
  364.         call    InitScanString
  365.         call    ScanMemory   
  366.         call    InitScanString
  367.         
  368.    DoneInt01:
  369.         pop     di si ds es dx cx bx ax
  370.         pop     bp
  371.         iret
  372.  
  373. InitScanString:
  374.         push    ds si cx
  375.         push    cs
  376.         pop     ds
  377.         mov     si,offset QueegScan1
  378.         mov     cx,EndScan1-QueegScan1
  379.    DecryptString:        
  380.         xor     byte ptr [si],42
  381.         inc     si
  382.         loop    DecryptString
  383.         pop     cx si ds
  384.         ret
  385.  
  386. TerminateProgram:
  387.         mov     byte ptr cs:[TraceDone],1
  388.         mov     ax,4c00
  389.         int     21
  390.  
  391. CheckOpCode:
  392.         mov     si,[bp+2]
  393.         mov     ds,si
  394.         mov     si,[bp]
  395.         cmp     byte ptr dS:[si],0cdh
  396.         je      NonvalidOp
  397.         cmp     byte ptr ds:[si],0eah
  398.         je      NonvalidOp
  399.         cmp     byte ptr ds:[si],09ah
  400.         je      NonvalidOp
  401.         cmp     byte ptr ds:[si],0abh
  402.         je      NonvalidOp
  403.         cmp     byte ptr ds:[si],0adh
  404.         je      NonvalidOp
  405.         mov     al,byte ptr ds:[si]
  406.         and     al,0f0
  407.         cmp     al,60
  408.         je      NonvalidOp
  409.         cmp     al,90
  410.         je      NonvalidOp
  411.         cmp     al,0a0
  412.         je      NonvalidOp
  413.         cmp     word ptr ds:[si],00e8
  414.         jne     ExitOpTest
  415.         cmp     word ptr ds:[si+2],5800
  416.   ExitOpTest:
  417.         ret
  418.  
  419. NonValidOp:
  420.         jmp     TerminatePRogram
  421.  
  422.  
  423. CheckESDS:
  424.         mov     ax,[bp+2]
  425.         cmp     ax,word ptr cs:[NewCS]
  426.         je      CSOkay
  427.         jmp     TerminateProgram
  428. CSOkay:
  429.         mov     ax,[bp+2]
  430.         mov     bx,ds
  431.         cmp     bx,ax
  432.         jne     DSNotEqualCS
  433.   CheckES:        
  434.         mov     bx,es
  435.         cmp     bx,ax
  436.         jne     ESNotEqualCS
  437.   ExitSEGCheck:        
  438.         ret
  439. DSNotEqualCS:
  440.         cmp     bx,word ptr cs:[StartDS]   
  441.         je      CheckES
  442.         mov     byte ptr cs:[TraceDone],1
  443.         jmp     TerminateProgram
  444.    ESNotEqualCS:
  445.         cmp     bx,word ptr cs:[StartDS]
  446.         je      ExitSEGCheck
  447.         mov     byte ptr cs:[TraceDone],1
  448.         jmp     TerminateProgram
  449.  
  450. ScanMemory:
  451.         push    cs
  452.         pop     ds
  453.         mov     si,offset QueegScan1
  454.         mov     di,[bp+2]
  455.         mov     es,di
  456.         mov     di,[bp]
  457.         mov     cx,800
  458.         lodsb        
  459.    SearchForString:        
  460.         repnz   scasb
  461.         jcxz    StringNotFound
  462.         push    ax cx si di 
  463.         mov     cx,0bh
  464.         repz    cmpsb
  465.         jcxz    StringFound
  466.         pop     di si cx ax
  467.         jmp     SearchForString
  468. StringFound:
  469.         pop     di si cx ax
  470. SaveInfo:
  471.         dec     di              ;ES:DI = beginning of virus
  472.         push    es di
  473.         pop     si ds
  474.  
  475. ;ds:si+133       22 c0 75 19 bb 00 01 2e a1
  476.      MakeSureKnowVir:
  477.         cmp     word ptr ds:[si+33],0c022
  478.         jne     NotKnown
  479.         cmp     word ptr ds:[si+39],2e01
  480.         jne     NotKnown
  481.         mov     byte ptr cs:[knownvir],1
  482.         jmp     DoneVarCheck
  483.      NotKnown:
  484.         mov     byte ptr cs:[knownvir],0
  485.      DoneVarCheck:
  486.         mov     bx,si
  487.         sub     bx,100
  488.         
  489.         mov     si,word ptr ds:[bx+13c]
  490.         add     si,bx
  491.         push    cs
  492.         pop     es
  493.         mov     di,offset COMStorage
  494.         movsw
  495.         movsb
  496.         
  497.         mov     si,word ptr ds:[bx+164]
  498.         add     si,bx
  499.         mov     di,offset EXEStack
  500.         movsw
  501.         movsw
  502.         
  503.         mov     si,word ptr ds:[bx+171]
  504.         add     si,bx
  505.         mov     di,offset EXEInstruct
  506.         movsw
  507.         movsw
  508. MarkInfected:
  509.         mov     byte ptr cs:[Infected],1
  510.         call    InitScanString
  511.         jmp     TerminateProgram
  512. StringNotFound:
  513.         ret
  514.  
  515. OutOfMemory:
  516.         mov     dx,offset OOM
  517.  ErrExit:        
  518.         push    cs
  519.         pop     ds
  520.         mov     ah,9
  521.         int     21
  522.         mov     ax,4c02
  523.         int     21
  524.  
  525. ErrorClean:
  526.         mov     dx,offset FileError
  527.         mov     ah,09
  528.         push    cs
  529.         pop     ds
  530.         int     21
  531.         jmp     Dealloc
  532.  
  533. DisinfCom:
  534.         mov     ah,48
  535.         mov     bx,1000
  536.         int     21
  537.         jc      OutOfMemory
  538.         mov     es,ax
  539.         mov     dx,9e
  540.         mov     ax,3d00
  541.         int     21
  542.         jc      ErrorClean
  543.         xchg    bx,ax
  544.         push    es
  545.         pop     ds
  546.         xor     dx,dx
  547.         mov     cx,word ptr cs:[ComJump]
  548.         add     cx,3
  549.         mov     ah,3f
  550.         int     21
  551.         push    ax
  552.         mov     ah,3e
  553.         int     21
  554.         mov     ax,word ptr cs:[COMStorage]
  555.         mov     word ptr ds:[0],ax
  556.         mov     al,byte ptr cs:[ComStorage+2]
  557.         mov     byte ptr ds:[2],al
  558.         push    cs        
  559.         pop     ds
  560.         mov     ah,3c
  561.         xor     cx,cx
  562.         mov     dx,9e
  563.         int     21
  564.         pop     cx        
  565.         jc      ErrorClean
  566.         xchg    bx,ax
  567.  
  568.         push    es
  569.         pop     ds
  570.         mov     ah,40
  571.         xor     dx,dx
  572.         int     21
  573.  
  574.         mov     ah,3e
  575.         int     21
  576.   DeAlloc:
  577.         mov     ah,49
  578.         int     21
  579.         push    cs cs
  580.         pop     es ds
  581.         ret
  582.  
  583. EXEErrorClean:
  584.         mov     dx,offset FileError
  585.         mov     ah,09
  586.         push    cs
  587.         pop     ds
  588.         int     21
  589.         ret
  590.  
  591.  
  592. DisinfEXE:
  593.         int     3
  594.         mov     ah,41
  595.         mov     dx,offset TMPFile       
  596.         int     21
  597.  
  598.         push    cs cs
  599.         pop     es ds
  600.         mov     dx,9e
  601.         mov     ax,3d02        ;open file
  602.         int     21
  603.         jnc     EXECOpenGood
  604.         jmp     EXEErrorClean
  605.      ExecOpenGood:
  606.         xchg    bx,ax
  607.         mov     cx,20
  608.         mov     ah,3f
  609.         mov     dx,offset ExecHeader
  610.         int     21
  611.         mov     di,offset Execheader+0e
  612.         mov     si,offset ExeStack
  613.         movsw
  614.         movsw
  615.         xor     bp,bp
  616.         mov     di,offset execheader+14
  617.         mov     dx,[di+2]               ;DX:AX = new filesize kinda
  618.         mov     ax,[di]
  619.         mov     cl,4
  620.         shl     dx,cl
  621.         adc     bp,0
  622.         add     ax,dx
  623.         adc     bp,0
  624.         mov     dx,bp                   ;DX:AX = filesize w/o header
  625.         mov     cx,word ptr [execheader+08]
  626.         shl     cx,1
  627.         shl     cx,1
  628.         shl     cx,1
  629.         shl     cx,1
  630.         add     ax,cx        
  631.         adc     dx,0                    ;Header now calculated in
  632.         mov     ExeSizeHigh,dx
  633.         mov     ExeSizeLow,ax
  634.         and     ax,1ff                      ;modulo 512
  635.         mov     word ptr [execheader+2],ax
  636.         mov     ax,EXESizeLow
  637.         mov     cx,7
  638.         shl     dx,cl
  639.         mov     word ptr [execheader+4],dx
  640.         mov     cx,9
  641.         add     ax,1ff
  642.         shr     ax,cl
  643.         add     word ptr [execheader+4],ax
  644.         
  645.         mov     si,offset ExeInstruct
  646.         movsw
  647.         movsw
  648.  
  649.         mov     ax,4200
  650.         xor     cx,cx
  651.         xor     dx,dx
  652.         int     21
  653.         mov     ah,40
  654.         mov     dx,offset execheader
  655.         mov     cx,20
  656.         int     21
  657.         mov     ah,3e
  658.         int     21
  659.  
  660.         mov     ah,56
  661.         mov     dx,9e
  662.         mov     di,offset TmpFile       ;Rename file
  663.         int     21
  664.  
  665.         mov     ah,3c
  666.         mov     dx,9e
  667.         xor     cx,cx
  668.         int     21
  669.         mov     Dest,ax
  670.         mov     ax,3d00
  671.         mov     dx,offset TmpFile
  672.         int     21
  673.         mov     Source,ax
  674.         
  675.      CopyLoop:
  676.         mov     cx,400
  677.         cmp     word ptr [EXESizeHIgh],0
  678.         jne     FullSize
  679.         cmp     word ptr [ExeSizeLow],400
  680.         ja      FullSize
  681.         mov     cx,word ptr [ExeSizeLow]
  682.     FullSize:
  683.         sub     word ptr [ExeSizeLow],400
  684.         sbb     word ptr [ExeSizeHigh],0
  685.         mov     ah,3f
  686.         mov     bx,Source
  687.         mov     dx,offset CopyBuffer
  688.         int     21
  689.         
  690.         mov     cx,ax
  691.         mov     ah,40
  692.         mov     bx,Dest
  693.         mov     dx,offset CopyBuffer
  694.         int     21
  695.  
  696.         cmp     ax,400
  697.         je      CopyLoop
  698.  
  699. CloseUP:
  700.         mov     ah,3e
  701.         mov     bx,Dest
  702.         int     21
  703.         mov     ah,3e
  704.         mov     bx,Source
  705.         int     21
  706.  DoneDis:
  707.         mov     ah,41
  708.         mov     dx,offset TMPFile       
  709.         int     21
  710.         ret
  711.  
  712. Source   dw      0
  713. Dest    dw      0
  714. OldInt01:
  715.         IP01    dw      0
  716.         CS01    dw      0
  717.  
  718. TraceDone       db      0
  719. StartDS         dw      0
  720.  
  721.  
  722. ParmBlock:
  723.    EnvSeg       dw      0
  724.    CommandTail  dd      0
  725.    FCB1         dd      0
  726.    FCB2         dd      0
  727.    NewStack     dd      0
  728.    NewIP        dw      0
  729.    NEWCS        dw      0
  730.  
  731. Tmpfile         db      'KQTMP',0
  732. NewVar          db      ' - New Variant of SMEG!',0a,0dh,24
  733. FileError       db      'Sorry, File Error.',07,0a,0dh,24
  734. OOM             db      'Sorry, Out Of Memory',07,0a,0dh,24
  735. Checking        db      'Checking $'
  736. OpenError       db      ' - Error Opening.'
  737. DoneChecking    db      0a,0dh,24
  738. TimeMSG         db      ' - Time stamp is suspicious of SMEG.Queeg signature.',0a,0dh,24
  739. pathtimemsg     db      ' - Time stamp is suspicious of SMEG.Pathogen signature.',0a,0dh,24
  740. InfectedMSG     db      ' - INFECTED WITH SMEG!',0a,0dh
  741.                 db      'Disinfect (y/N)?',7,24
  742. IntroMSG        db      0a,0dh,'KillSMEG (c) 1994 Stormbringer, Phalcon/Skism.',0a,0dh
  743.                 db      'Finds and disinfects the 2 known SMEG viruses in the current directory.',0a,0dh,24
  744.                 
  745. Instructions:                
  746.                 db      'Usage :    KILLSMEG Filemask (COM once, then EXE once is recommended)',0a,0dh
  747.                 db      'Example:   KILLSMEG *.COM',0a,0dh,24
  748.  
  749. QueegScan1:
  750. db 0E8 xor 42, 00 xor 42, 00 xor 42, 58 xor 42, 0FE xor 42, 0CC xor 42
  751. db 0B1 xor 42, 04 xor 42, 0D3 xor 42, 0E8 xor 42, 08C xor 42, 0CBh xor 42      ;Initializing Code
  752. EndScan1:
  753. ;QueegScan2:
  754. ;db 0B8, 0EF, 18, 0CDh, 21, 3Dh, 10, 0E7, 75, 01, 0C3, 0E8    ;Installation Check
  755.  
  756.  
  757. ParmData        db      40 dup(0)
  758. knownvir        db      0
  759. Jmpbyte         db      0
  760. COMJump         db      0,0
  761.  
  762. Infected        db      0
  763. COMEXE          db      0                       ;0 for COM, 1 for EXE
  764. EXECCheck       dw      0,0
  765.  
  766. COMStorage      db      0,0,0
  767. EXEStack        dd      0
  768. EXEInstruct     dd      0
  769.  
  770. ;0f9d-SP  0f9b-SS  0fa0-IP:CS
  771. ExeSizeLow      dw      0
  772. EXESizeHigh     dw      0
  773.  
  774.  
  775. Filenamebuf     db      80d dup (?)
  776. ExecHeader      db      20 dup(?)
  777. CopyBuffer      db      400 dup(?)
  778. StackBuffer db  1000 dup(?)
  779. TopStack:
  780.  
  781. endfinder:
  782. end start
  783. ---------------------------
  784. N KILLSMEG.COM
  785. E 0100 B4 4A BB CC 01 CD 21 BC C0 1C B4 09 BA 0C 07 CD 
  786. E 0110 21 80 3E 80 00 01 77 0C B4 09 BA 88 07 CD 21 B8 
  787. E 0120 00 4C CD 21 BE 82 00 BF 50 08 AC 3C 0D 74 03 AA 
  788. E 0130 EB F8 32 C0 AA B4 4E BA 50 08 B9 07 00 CD 21 73 
  789. E 0140 03 E9 BE 00 E8 D6 00 8B 0E 96 00 80 E1 1F 80 F9 
  790. E 0150 1C 75 03 E8 B1 00 8B 0E 98 00 80 FD C8 72 03 E8 
  791. E 0160 B0 00 B8 00 3D BA 9E 00 CD 21 73 03 E9 87 00 93 
  792. E 0170 BA 3D 08 B9 04 00 B4 3F CD 21 B4 3E CD 21 A1 3D 
  793. E 0180 08 32 E0 80 FC 17 74 11 0E 07 BF 38 08 BE 3D 08 
  794. E 0190 A4 A5 C6 06 3C 08 00 EB 05 C6 06 3C 08 01 C6 06 
  795. E 01A0 3B 08 00 90 C6 06 EC 05 00 90 E8 93 00 80 3E 3B 
  796. E 01B0 08 01 75 3D E8 78 00 80 3E 37 08 01 74 0A B4 09 
  797. E 01C0 BA 0B 06 CD 21 EB 2A 90 B4 09 BA E2 06 CD 21 33 
  798. E 01D0 C0 CD 16 50 BA 6E 06 B4 09 CD 21 58 0C 20 3C 79 
  799. E 01E0 75 0F 80 3E 3C 08 01 74 05 E8 85 02 EB 03 E8 E7 
  800. E 01F0 02 B4 4F E9 47 FF E8 36 00 B4 09 BA 5D 06 CD 21 
  801. E 0200 EB EF B8 00 4C CD 21 E8 25 00 B4 09 BA 71 06 CD 
  802. E 0210 21 C3 E8 1A 00 B4 09 BA A8 06 CD 21 C3 BA 53 06 
  803. E 0220 B4 09 CD 21 E8 08 00 BA 6E 06 B4 09 CD 21 C3 BE 
  804. E 0230 9E 00 AC 0A C0 74 08 B4 02 8A D0 CD 21 EB F3 C3 
  805. E 0240 0E 1F A1 2C 00 A3 EF 05 8C D8 A3 F3 05 A3 F7 05 
  806. E 0250 A3 FB 05 B8 F7 07 A3 F1 05 A3 F5 05 A3 F9 05 B8 
  807. E 0260 01 35 CD 21 89 1E E8 05 8C 06 EA 05 B8 01 25 BA 
  808. E 0270 09 03 CD 21 8C D0 A3 05 03 89 26 07 03 0E 07 B8 
  809. E 0280 01 4B BB EF 05 BA 9E 00 CD 21 72 78 0E 1F B8 22 
  810. E 0290 25 BA DA 02 CD 21 B4 62 CD 21 53 53 07 1F 2E 89 
  811. E 02A0 1E ED 05 8C C8 C7 06 0A 00 DA 02 A3 0C 00 FA 2E 
  812. E 02B0 A1 FF 05 8E D0 2E 8B 26 FD 05 FB 9C 58 0D 00 01 
  813. E 02C0 33 DB 33 C9 33 D2 BE 00 01 33 FF 33 ED 2E FF 36 
  814. E 02D0 03 06 2E FF 36 01 06 50 9D CB FC 9C 58 25 FF FE 
  815. E 02E0 50 9D FA 2E A1 05 03 8E D0 2E 8B 26 07 03 FB 2E 
  816. E 02F0 C5 16 E8 05 B8 01 25 CD 21 0E 0E 07 1F B4 1A BA 
  817. E 0300 80 00 CD 21 C3 00 00 00 00 FC 55 8B EC 83 C5 02 
  818. E 0310 50 53 51 52 06 1E 56 57 2E 80 3E EC 05 01 74 11 
  819. E 0320 E8 77 00 E8 35 00 75 09 E8 10 00 E8 A7 00 E8 0A 
  820. E 0330 00 5F 5E 1F 07 5A 59 5B 58 5D CF 1E 56 51 0E 1F 
  821. E 0340 BE EB 07 B9 0C 00 80 34 42 46 E2 FA 59 5E 1F C3 
  822. E 0350 2E C6 06 EC 05 01 B8 00 4C CD 21 8B 76 02 8E DE 
  823. E 0360 8B 76 00 80 3C CD 74 30 80 3C EA 74 2B 80 3C 9A 
  824. E 0370 74 26 80 3C AB 74 21 80 3C AD 74 1C 8A 04 24 F0 
  825. E 0380 3C 60 74 14 3C 90 74 10 3C A0 74 0C 81 3C E8 00 
  826. E 0390 75 05 81 7C 02 00 58 C3 EB B6 8B 46 02 2E 3B 06 
  827. E 03A0 03 06 74 02 EB AA 8B 46 02 8C DB 3B D8 75 07 8C 
  828. E 03B0 C3 3B D8 75 10 C3 2E 3B 1E ED 05 74 F2 2E C6 06 
  829. E 03C0 EC 05 01 EB 8B 2E 3B 1E ED 05 74 E9 2E C6 06 EC 
  830. E 03D0 05 01 E9 7B FF 0E 1F BE EB 07 8B 7E 02 8E C7 8B 
  831. E 03E0 7E 00 B9 00 08 AC F2 AE E3 6C 50 51 56 57 B9 0B 
  832. E 03F0 00 F3 A6 E3 06 5F 5E 59 58 EB EB 5F 5E 59 58 4F 
  833. E 0400 06 57 5E 1F 81 7C 33 22 C0 75 10 81 7C 39 01 2E 
  834. E 0410 75 09 2E C6 06 37 08 01 EB 07 90 2E C6 06 37 08 
  835. E 0420 00 8B DE 81 EB 00 01 8B B7 3C 01 03 F3 0E 07 BF 
  836. E 0430 41 08 A5 A4 8B B7 64 01 03 F3 BF 44 08 A5 A5 8B 
  837. E 0440 B7 71 01 03 F3 BF 48 08 A5 A5 2E C6 06 3B 08 01 
  838. E 0450 E8 E8 FE E9 FA FE C3 BA 3B 06 0E 1F B4 09 CD 21 
  839. E 0460 B8 02 4C CD 21 BA 25 06 B4 09 0E 1F CD 21 EB 55 
  840. E 0470 90 B4 48 BB 00 10 CD 21 72 DD 8E C0 BA 9E 00 B8 
  841. E 0480 00 3D CD 21 72 DF 93 06 1F 33 D2 2E 8B 0E 39 08 
  842. E 0490 83 C1 03 B4 3F CD 21 50 B4 3E CD 21 2E A1 41 08 
  843. E 04A0 A3 00 00 2E A0 43 08 A2 02 00 0E 1F B4 3C 33 C9 
  844. E 04B0 BA 9E 00 CD 21 59 72 AD 93 06 1F B4 40 33 D2 CD 
  845. E 04C0 21 B4 3E CD 21 B4 49 CD 21 0E 0E 07 1F C3 BA 25 
  846. E 04D0 06 B4 09 0E 1F CD 21 C3 CC B4 41 BA 05 06 CD 21 
  847. E 04E0 0E 0E 07 1F BA 9E 00 B8 02 3D CD 21 73 02 EB DE 
  848. E 04F0 93 B9 20 00 B4 3F BA A0 08 CD 21 BF AE 08 BE 44 
  849. E 0500 08 A5 A5 33 ED BF B4 08 8B 55 02 8B 05 B1 04 D3 
  850. E 0510 E2 83 D5 00 03 C2 83 D5 00 8B D5 8B 0E A8 08 D1 
  851. E 0520 E1 D1 E1 D1 E1 D1 E1 03 C1 83 D2 00 89 16 4E 08 
  852. E 0530 A3 4C 08 25 FF 01 A3 A2 08 A1 4C 08 B9 07 00 D3 
  853. E 0540 E2 89 16 A4 08 B9 09 00 05 FF 01 D3 E8 01 06 A4 
  854. E 0550 08 BE 48 08 A5 A5 B8 00 42 33 C9 33 D2 CD 21 B4 
  855. E 0560 40 BA A0 08 B9 20 00 CD 21 B4 3E CD 21 B4 56 BA 
  856. E 0570 9E 00 BF 05 06 CD 21 B4 3C BA 9E 00 33 C9 CD 21 
  857. E 0580 A3 E6 05 B8 00 3D BA 05 06 CD 21 A3 E4 05 B9 00 
  858. E 0590 04 83 3E 4E 08 00 75 0C 81 3E 4C 08 00 04 77 04 
  859. E 05A0 8B 0E 4C 08 81 2E 4C 08 00 04 83 1E 4E 08 00 B4 
  860. E 05B0 3F 8B 1E E4 05 BA C0 08 CD 21 8B C8 B4 40 8B 1E 
  861. E 05C0 E6 05 BA C0 08 CD 21 3D 00 04 74 C2 B4 3E 8B 1E 
  862. E 05D0 E6 05 CD 21 B4 3E 8B 1E E4 05 CD 21 B4 41 BA 05 
  863. E 05E0 06 CD 21 C3 00 00 00 00 00 00 00 00 00 00 00 00 
  864. E 05F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  865. E 0600 00 00 00 00 00 4B 51 54 4D 50 00 20 2D 20 4E 65 
  866. E 0610 77 20 56 61 72 69 61 6E 74 20 6F 66 20 53 4D 45 
  867. E 0620 47 21 0A 0D 24 53 6F 72 72 79 2C 20 46 69 6C 65 
  868. E 0630 20 45 72 72 6F 72 2E 07 0A 0D 24 53 6F 72 72 79 
  869. E 0640 2C 20 4F 75 74 20 4F 66 20 4D 65 6D 6F 72 79 07 
  870. E 0650 0A 0D 24 43 68 65 63 6B 69 6E 67 20 24 20 2D 20 
  871. E 0660 45 72 72 6F 72 20 4F 70 65 6E 69 6E 67 2E 0A 0D 
  872. E 0670 24 20 2D 20 54 69 6D 65 20 73 74 61 6D 70 20 69 
  873. E 0680 73 20 73 75 73 70 69 63 69 6F 75 73 20 6F 66 20 
  874. E 0690 53 4D 45 47 2E 51 75 65 65 67 20 73 69 67 6E 61 
  875. E 06A0 74 75 72 65 2E 0A 0D 24 20 2D 20 54 69 6D 65 20 
  876. E 06B0 73 74 61 6D 70 20 69 73 20 73 75 73 70 69 63 69 
  877. E 06C0 6F 75 73 20 6F 66 20 53 4D 45 47 2E 50 61 74 68 
  878. E 06D0 6F 67 65 6E 20 73 69 67 6E 61 74 75 72 65 2E 0A 
  879. E 06E0 0D 24 20 2D 20 49 4E 46 45 43 54 45 44 20 57 49 
  880. E 06F0 54 48 20 53 4D 45 47 21 0A 0D 44 69 73 69 6E 66 
  881. E 0700 65 63 74 20 28 79 2F 4E 29 3F 07 24 0A 0D 4B 69 
  882. E 0710 6C 6C 53 4D 45 47 20 28 63 29 20 31 39 39 34 20 
  883. E 0720 53 74 6F 72 6D 62 72 69 6E 67 65 72 2C 20 50 68 
  884. E 0730 61 6C 63 6F 6E 2F 53 6B 69 73 6D 2E 0A 0D 46 69 
  885. E 0740 6E 64 73 20 61 6E 64 20 64 69 73 69 6E 66 65 63 
  886. E 0750 74 73 20 74 68 65 20 32 20 6B 6E 6F 77 6E 20 53 
  887. E 0760 4D 45 47 20 76 69 72 75 73 65 73 20 69 6E 20 74 
  888. E 0770 68 65 20 63 75 72 72 65 6E 74 20 64 69 72 65 63 
  889. E 0780 74 6F 72 79 2E 0A 0D 24 55 73 61 67 65 20 3A 20 
  890. E 0790 20 20 20 4B 49 4C 4C 53 4D 45 47 20 46 69 6C 65 
  891. E 07A0 6D 61 73 6B 20 28 43 4F 4D 20 6F 6E 63 65 2C 20 
  892. E 07B0 74 68 65 6E 20 45 58 45 20 6F 6E 63 65 20 69 73 
  893. E 07C0 20 72 65 63 6F 6D 6D 65 6E 64 65 64 29 0A 0D 45 
  894. E 07D0 78 61 6D 70 6C 65 3A 20 20 20 4B 49 4C 4C 53 4D 
  895. E 07E0 45 47 20 2A 2E 43 4F 4D 0A 0D 24 AA 42 42 1A BC 
  896. E 07F0 8E F3 46 91 AA CE 89 00 00 00 00 00 00 00 00 00 
  897. E 0800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  898. E 0810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  899. E 0820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  900. E 0830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  901. E 0840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
  902. RCX
  903. 0750
  904. W
  905. Q
  906. ---------------------------
  907.